#!/usr/bin/env python3
# Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2
# This file is part of Checkmk (https://checkmk.com). It is subject to the terms and
# conditions defined in the file COPYING, which is part of this source code package.
from collections.abc import Mapping, Sequence
from typing import Any

import pytest

from cmk.agent_based.v2 import Metric, Result, Service, State
from cmk.plugins.aws.agent_based.aws_rds import (
    check_aws_rds,
    check_aws_rds_agent_jobs,
    check_aws_rds_bin_log_usage,
    check_aws_rds_connections,
    check_aws_rds_cpu_credits,
    check_aws_rds_disk_io,
    check_aws_rds_network_io,
    check_aws_rds_replica_lag,
    check_aws_rds_replication_slot_usage,
    check_aws_rds_transaction_logs_usage,
    discover_aws_rds,
    discover_aws_rds_agent_jobs,
    discover_aws_rds_bin_log_usage,
    discover_aws_rds_connections,
    discover_aws_rds_cpu_credits,
    discover_aws_rds_disk_io,
    discover_aws_rds_replica_lag,
    discover_aws_rds_replication_slot_usage,
    discover_aws_rds_transaction_logs_usage,
    parse_aws_rds,
)
from cmk.plugins.aws.lib import AWSSectionMetrics

SECTION = {
    "database-1 [eu-central-1]": {
        "BinLogDiskUsage": 1783.4,
        "DBInstanceIdentifier": "database-1",
        "AllocatedStorage": 21480000000.0,
        "Region": "eu-central-1",
        "BurstBalance": 100.0,
        "CPUUtilization": 2.3550349634157652,
        "CPUCreditUsage": 0.116523,
        "CPUCreditBalance": 0.403469,
        "DatabaseConnections": 0.0,
        "DiskQueueDepth": 0.0002666533349034978,
        "NetworkReceiveThroughput": 417.41570964272285,
        "NetworkTransmitThroughput": 2671.1907577121706,
        "ReadIOPS": 0.23333527781018573,
        "ReadLatency": 4e-05,
        "ReadThroughput": 136.53447113007437,
        "WriteIOPS": 0.3249847523733059,
        "WriteLatency": 0.00024792140430921573,
        "WriteThroughput": 3338.060601250865,
    },
}


def test_parse_aws_rds() -> None:
    assert (
        parse_aws_rds(
            [
                [
                    '[{"Id":',
                    '"id_0_BinLogDiskUsage",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[1783.4,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_BurstBalance",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[100.0,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_CPUUtilization",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[2.3550349634157652,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_CPUCreditUsage",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.116523,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_CPUCreditBalance",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.403469,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_DatabaseConnections",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.0,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_DiskQueueDepth",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.0002666533349034978,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_FailedSQLServerAgentJobsCount",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    "[],",
                    '"Values":',
                    "[],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_NetworkReceiveThroughput",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[417.41570964272285,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_NetworkTransmitThroughput",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[2671.1907577121706,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_OldestReplicationSlotLag",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    "[],",
                    '"Values":',
                    "[],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_ReadIOPS",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.23333527781018573,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_ReadLatency",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[4e-05,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_ReadThroughput",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[136.53447113007437,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_ReplicaLag",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    "[],",
                    '"Values":',
                    "[],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_ReplicationSlotDiskUsage",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    "[],",
                    '"Values":',
                    "[],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_TransactionLogsDiskUsage",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    "[],",
                    '"Values":',
                    "[],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_TransactionLogsGeneration",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    "[],",
                    '"Values":',
                    "[],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_WriteIOPS",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.3249847523733059,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_WriteLatency",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[0.00024792140430921573,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"},',
                    '{"Id":',
                    '"id_0_WriteThroughput",',
                    '"Label":',
                    '"database-1',
                    'eu-central-1",',
                    '"Timestamps":',
                    '["2020-12-01',
                    '15:33:00+00:00"],',
                    '"Values":',
                    "[[3338.060601250865,",
                    "null]],",
                    '"StatusCode":',
                    '"Complete",',
                    '"DBInstanceIdentifier":',
                    '"database-1",',
                    '"DBInstanceClass":',
                    '"db.t2.micro",',
                    '"Engine":',
                    '"mysql",',
                    '"DBInstanceStatus":',
                    '"available",',
                    '"MasterUsername":',
                    '"admin",',
                    '"Endpoint":',
                    '{"Address":',
                    '"database-1.cmnt1xq2gwhj.eu-central-1.rds.amazonaws.com",',
                    '"Port":',
                    "3306,",
                    '"HostedZoneId":',
                    '"Z1RLNUO7B9Q6NB"},',
                    '"AllocatedStorage":',
                    "20,",
                    '"InstanceCreateTime":',
                    '"2020-12-01',
                    '15:20:24.279000+00:00",',
                    '"PreferredBackupWindow":',
                    '"22:55-23:25",',
                    '"BackupRetentionPeriod":',
                    "7,",
                    '"DBSecurityGroups":',
                    "[],",
                    '"VpcSecurityGroups":',
                    '[{"VpcSecurityGroupId":',
                    '"sg-06368b02de2a8b850",',
                    '"Status":',
                    '"active"}],',
                    '"DBParameterGroups":',
                    '[{"DBParameterGroupName":',
                    '"default.mysql8.0",',
                    '"ParameterApplyStatus":',
                    '"in-sync"}],',
                    '"AvailabilityZone":',
                    '"eu-central-1b",',
                    '"DBSubnetGroup":',
                    '{"DBSubnetGroupName":',
                    '"default-vpc-dc8ba3b7",',
                    '"DBSubnetGroupDescription":',
                    '"Created',
                    "from",
                    "the",
                    "RDS",
                    "Management",
                    'Console",',
                    '"VpcId":',
                    '"vpc-dc8ba3b7",',
                    '"SubnetGroupStatus":',
                    '"Complete",',
                    '"Subnets":',
                    '[{"SubnetIdentifier":',
                    '"subnet-1680ce6b",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1b"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-2074296d",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1c"},',
                    '"SubnetStatus":',
                    '"Active"},',
                    '{"SubnetIdentifier":',
                    '"subnet-dc0417b7",',
                    '"SubnetAvailabilityZone":',
                    '{"Name":',
                    '"eu-central-1a"},',
                    '"SubnetStatus":',
                    '"Active"}]},',
                    '"PreferredMaintenanceWindow":',
                    '"sat:03:35-sat:04:05",',
                    '"PendingModifiedValues":',
                    "{},",
                    '"LatestRestorableTime":',
                    '"2020-12-01',
                    '15:40:00+00:00",',
                    '"MultiAZ":',
                    "false,",
                    '"EngineVersion":',
                    '"8.0.20",',
                    '"AutoMinorVersionUpgrade":',
                    "true,",
                    '"ReadReplicaDBInstanceIdentifiers":',
                    "[],",
                    '"LicenseModel":',
                    '"general-public-license",',
                    '"OptionGroupMemberships":',
                    '[{"OptionGroupName":',
                    '"default:mysql-8-0",',
                    '"Status":',
                    '"in-sync"}],',
                    '"PubliclyAccessible":',
                    "false,",
                    '"StorageType":',
                    '"gp2",',
                    '"DbInstancePort":',
                    "0,",
                    '"StorageEncrypted":',
                    "false,",
                    '"DbiResourceId":',
                    '"db-6J5U7HWIBKIUK22446YDXCMHIU",',
                    '"CACertificateIdentifier":',
                    '"rds-ca-2019",',
                    '"DomainMemberships":',
                    "[],",
                    '"CopyTagsToSnapshot":',
                    "true,",
                    '"MonitoringInterval":',
                    "0,",
                    '"DBInstanceArn":',
                    '"arn:aws:rds:eu-central-1:710145618630:db:database-1",',
                    '"IAMDatabaseAuthenticationEnabled":',
                    "false,",
                    '"PerformanceInsightsEnabled":',
                    "false,",
                    '"DeletionProtection":',
                    "false,",
                    '"AssociatedRoles":',
                    "[],",
                    '"MaxAllocatedStorage":',
                    "1000,",
                    '"Region":',
                    '"eu-central-1"}]',
                ]
            ]
        )
        == SECTION
    )


@pytest.mark.usefixtures("initialised_item_state")
def test_check_aws_rds_network_io() -> None:
    assert list(
        check_aws_rds_network_io(
            "database-1 [eu-central-1]",
            {},
            SECTION,
        )
    ) == [
        Result(state=State.OK, summary="[database-1]"),
        Result(state=State.OK, summary="(up)", details="Operational state: up"),
        Result(state=State.OK, summary="Speed: unknown"),
        Result(state=State.OK, summary="In: 417 B/s"),
        Metric("in", 417.41570964272285, boundaries=(0.0, None)),
        Result(state=State.OK, summary="Out: 2.67 kB/s"),
        Metric("out", 2671.1907577121706, boundaries=(0.0, None)),
    ]


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            SECTION,
            [Service(item="database-1 [eu-central-1]")],
            id="For every disk in the section a Service is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_ec2_disk_io_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_disk_io(section)) == discovery_result


@pytest.mark.usefixtures("initialised_item_state")
def test_check_aws_rds_disk_io() -> None:
    check_result = list(
        check_aws_rds_disk_io(
            item="database-1 [eu-central-1]",
            params={},
            section=SECTION,
        )
    )
    assert len(check_result) == 12
    assert check_result == [
        Result(state=State.OK, summary="Read: 137 B/s"),
        Metric("disk_read_throughput", 136.53447113007437),
        Result(state=State.OK, summary="Write: 3.34 kB/s"),
        Metric("disk_write_throughput", 3338.060601250865),
        Result(state=State.OK, notice="Read operations: 0.23/s"),
        Metric("disk_read_ios", 0.23333527781018573),
        Result(state=State.OK, notice="Write operations: 0.32/s"),
        Metric("disk_write_ios", 0.3249847523733059),
        Result(state=State.OK, notice="Read latency: 40 milliseconds"),
        Metric("disk_read_latency", 0.04),
        Result(state=State.OK, notice="Write latency: 248 milliseconds"),
        Metric("disk_write_latency", 0.24792140430921572),
    ]


def test_check_aws_rds_disk_io_item_not_foung() -> None:
    check_result = list(
        check_aws_rds_disk_io(
            item="item_not_found",
            params={},
            section=SECTION,
        )
    )
    assert not check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"CPUUtilization": 99}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_discovery(
    section: AWSSectionMetrics,
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds(section)) == discovery_result


@pytest.mark.usefixtures("initialised_item_state")
@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"CPUUtilization": 99}},
            {},
            [
                Result(state=State.OK, summary="Total CPU: 99.00%"),
                Metric("util", 99.0, boundaries=(0.0, None)),
            ],
            id="If the ruleset is initialized and left blank, the result always be OK and display the appropriate description.",
        ),
        pytest.param(
            {"disk": {"CPUUtilization": 70}},
            {"util": (90.0, 95.0)},
            [
                Result(state=State.OK, summary="Total CPU: 70.00%"),
                Metric("util", 70.0, levels=(90.0, 95.0), boundaries=(0.0, None)),
            ],
            id="If the CPU Utilization is below the set boundaries, the result is OK and the appropriate description is displayed.",
        ),
        pytest.param(
            {"disk": {"CPUUtilization": 91}},
            {"util": (90.0, 95.0)},
            [
                Result(state=State.WARN, summary="Total CPU: 91.00% (warn/crit at 90.00%/95.00%)"),
                Metric("util", 91.0, levels=(90.0, 95.0), boundaries=(0.0, None)),
            ],
            id="If the CPU Utilization is above the set warning level, the result is WARN and the appropriate description is displayed.",
        ),
        pytest.param(
            {"disk": {"CPUUtilization": 99}},
            {"util": (90.0, 95.0)},
            [
                Result(state=State.CRIT, summary="Total CPU: 99.00% (warn/crit at 90.00%/95.00%)"),
                Metric("util", 99.0, levels=(90.0, 95.0), boundaries=(0.0, None)),
            ],
            id="If the CPU Utilization is above the set critical level, the result is CRIT and the appropriate description is displayed.",
        ),
    ],
)
def test_check_aws_rds(
    section: AWSSectionMetrics,
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert check_result == expected_check_result


def test_check_aws_rds_item_not_found() -> None:
    assert not list(
        check_aws_rds(
            item="disk",
            params={},
            section={},
        )
    )


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"FailedSQLServerAgentJobsCount": 99}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_agent_jobs_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_agent_jobs(section)) == discovery_result


def test_check_aws_rds_agent_jobs_item_not_found() -> None:
    assert not list(
        check_aws_rds_agent_jobs(
            item="disk",
            section={},
        )
    )


def test_check_aws_rds_agent_jobs_metric_not_found() -> None:
    with pytest.raises(KeyError):
        list(
            check_aws_rds_agent_jobs(
                item="disk",
                section={"disk": {"CPUUtilization": 1}},
            )
        )


@pytest.mark.parametrize(
    "section, expected_check_result",
    [
        pytest.param(
            {"disk": {"FailedSQLServerAgentJobsCount": 1.0}},
            [
                Result(state=State.WARN, summary="Rate of failing jobs: 1.000/s"),
            ],
            id="If there are any FailedSQLServerAgentJobs, the check state turn to WARN and provides a description with more information.",
        ),
        pytest.param(
            {"disk": {"FailedSQLServerAgentJobsCount": 0.0}},
            [
                Result(state=State.OK, summary="Rate of failing jobs: 0.000/s"),
            ],
            id="If there are no FailedSQLServerAgentJobs, the check state is OK.",
        ),
    ],
)
def test_check_aws_rds_agent_jobs(
    section: Mapping[str, Mapping[str, float]],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_agent_jobs(
            item="disk",
            section=section,
        )
    )
    assert check_result == expected_check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"CPUCreditUsage": 99, "CPUCreditBalance": 2}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_cpu_credits_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_cpu_credits(section)) == discovery_result


def test_check_aws_rds_cpu_credits_item_not_found() -> None:
    assert not list(
        check_aws_rds_cpu_credits(
            item="disk",
            params={},
            section={},
        )
    )


def test_check_aws_rds_cpu_credits_metric_not_found() -> None:
    with pytest.raises(KeyError):
        list(
            check_aws_rds_cpu_credits(
                item="disk",
                params={},
                section={"disk": {"CPUUtilization": 1}},
            )
        )


@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"CPUCreditUsage": 99, "CPUCreditBalance": 30, "BurstBalance": 30}},
            {"balance_levels_lower": (10, 5), "burst_balance_levels_lower": (10, 5)},
            [
                Result(state=State.OK, summary="CPU Credit Usage: 99.00"),
                Result(state=State.OK, summary="CPU Credit Balance: 30.00"),
                Metric("aws_cpu_credit_balance", 30.0),
                Result(state=State.OK, summary="Burst Balance: 30.00%"),
                Metric("aws_burst_balance", 30.0),
            ],
            id="If the levels are above the warn/crit levels, the check state will be OK with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"CPUCreditUsage": 99, "CPUCreditBalance": 8, "BurstBalance": 8}},
            {"balance_levels_lower": (10, 5), "burst_balance_levels_lower": (10, 5)},
            [
                Result(state=State.OK, summary="CPU Credit Usage: 99.00"),
                Result(
                    state=State.WARN,
                    summary="CPU Credit Balance: 8.00 (warn/crit below 10.00/5.00)",
                ),
                Metric("aws_cpu_credit_balance", 8.0),
                Result(
                    state=State.WARN, summary="Burst Balance: 8.00% (warn/crit below 10.00%/5.00%)"
                ),
                Metric("aws_burst_balance", 8.0),
            ],
            id="If the levels are below the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"CPUCreditUsage": 99, "CPUCreditBalance": 3, "BurstBalance": 3}},
            {"balance_levels_lower": (10, 5), "burst_balance_levels_lower": (10, 5)},
            [
                Result(state=State.OK, summary="CPU Credit Usage: 99.00"),
                Result(
                    state=State.CRIT,
                    summary="CPU Credit Balance: 3.00 (warn/crit below 10.00/5.00)",
                ),
                Metric("aws_cpu_credit_balance", 3.0),
                Result(
                    state=State.CRIT, summary="Burst Balance: 3.00% (warn/crit below 10.00%/5.00%)"
                ),
                Metric("aws_burst_balance", 3.0),
            ],
            id="If the levels are below the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"CPUCreditUsage": 99, "CPUCreditBalance": 30}},
            {"balance_levels_lower": (10, 5), "burst_balance_levels_lower": (10, 5)},
            [
                Result(state=State.OK, summary="CPU Credit Usage: 99.00"),
                Result(
                    state=State.OK,
                    summary="CPU Credit Balance: 30.00",
                ),
                Metric("aws_cpu_credit_balance", 30.0),
            ],
            id="If the BurstBalance metric is not present, no results are shown for it.",
        ),
    ],
)
def test_check_aws_rds_cpu_credits(
    section: Mapping[str, Mapping[str, float]],
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_cpu_credits(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert check_result[0] == Result(
        state=State.OK, summary="CPU Credit Usage: 99.00"
    )  # The first result is always OK and show the information about the CPU Credits Usage
    assert check_result == expected_check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"BinLogDiskUsage": 60.0}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_bin_log_usage_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_bin_log_usage(section)) == discovery_result


def test_check_aws_rds_bin_log_usage_item_not_found() -> None:
    assert not list(
        check_aws_rds_bin_log_usage(
            item="disk",
            params={},
            section={},
        )
    )


def test_check_aws_rds_bin_log_usage_metric_not_found() -> None:
    with pytest.raises(KeyError):
        list(
            check_aws_rds_bin_log_usage(
                item="disk",
                params={},
                section={"disk": {"CPUUtilization": 1}},
            )
        )


def test_check_aws_rds_bin_log_usage_no_allocated_storage() -> None:
    check_result = list(
        check_aws_rds_bin_log_usage(
            item="disk",
            params={},
            section={"disk": {"BinLogDiskUsage": 60.0}},
        )
    )
    assert check_result == [
        Result(state=State.OK, summary="60 B"),
        Result(state=State.WARN, summary="Cannot calculate usage"),
    ]


def test_check_aws_rds_bin_log_usage_allocated_storage_is_zero() -> None:
    check_result = list(
        check_aws_rds_bin_log_usage(
            item="disk",
            params={},
            section={"disk": {"BinLogDiskUsage": 60.0, "AllocatedStorage": 0.0}},
        )
    )
    assert check_result == [
        Result(state=State.OK, summary="60 B"),
        Result(state=State.WARN, summary="Cannot calculate usage"),
    ]


@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"BinLogDiskUsage": 60.0, "AllocatedStorage": 4000.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.OK, summary="1.50%"),
                Metric("aws_rds_bin_log_disk_usage", 1.5, levels=(90.0, 95.0)),
            ],
            id="If the BinLogDiskUsage levels are below the warn/crit levels, the check state will be OK with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"BinLogDiskUsage": 60.0, "AllocatedStorage": 65.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.WARN, summary="92.31% (warn/crit at 90.00%/95.00%)"),
                Metric("aws_rds_bin_log_disk_usage", 92.3076923076923, levels=(90.0, 95.0)),
            ],
            id="If the BinLogDiskUsage levels are above the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"BinLogDiskUsage": 60.0, "AllocatedStorage": 60.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.CRIT, summary="100.00% (warn/crit at 90.00%/95.00%)"),
                Metric("aws_rds_bin_log_disk_usage", 100.0, levels=(90.0, 95.0)),
            ],
            id="If the BinLogDiskUsage levels are above the crit levels, the check state will be CRIT with a appropriate description.",
        ),
    ],
)
def test_check_aws_rds_bin_log_usage(
    section: Mapping[str, Mapping[str, float]],
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_bin_log_usage(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert check_result[0] == Result(
        state=State.OK, summary="60 B"
    )  # The first result is always OK and shows the information about the BinLogDiskUsage in Bytes
    assert check_result == expected_check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"TransactionLogsDiskUsage": 60.0}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_transaction_logs_usage_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_transaction_logs_usage(section)) == discovery_result


def test_check_aws_rds_transaction_logs_usage_item_not_found() -> None:
    assert not list(
        check_aws_rds_transaction_logs_usage(
            item="disk",
            params={},
            section={},
        )
    )


def test_check_aws_rds_transaction_logs_usage_metric_not_found() -> None:
    with pytest.raises(KeyError):
        list(
            check_aws_rds_transaction_logs_usage(
                item="disk",
                params={},
                section={"disk": {"CPUUtilization": 1}},
            )
        )


def test_check_aws_rds_transaction_logs_usage_no_allocated_storage() -> None:
    check_result = list(
        check_aws_rds_transaction_logs_usage(
            item="disk",
            params={},
            section={"disk": {"TransactionLogsDiskUsage": 60.0}},
        )
    )
    assert check_result == [
        Result(state=State.OK, summary="60 B"),
        Result(state=State.WARN, summary="Cannot calculate usage"),
    ]


def test_check_aws_rds_transaction_logs_usage_allocated_storage_is_zero() -> None:
    check_result = list(
        check_aws_rds_transaction_logs_usage(
            item="disk",
            params={},
            section={"disk": {"TransactionLogsDiskUsage": 60.0, "AllocatedStorage": 0.0}},
        )
    )
    assert check_result == [
        Result(state=State.OK, summary="60 B"),
        Result(state=State.WARN, summary="Cannot calculate usage"),
    ]


@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"TransactionLogsDiskUsage": 60.0, "AllocatedStorage": 4000.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.OK, summary="1.50%"),
                Metric("aws_rds_transaction_logs_disk_usage", 1.5, levels=(90.0, 95.0)),
            ],
            id="If the TransactionLogsDiskUsage levels are below the warn/crit levels, the check state will be OK with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"TransactionLogsDiskUsage": 60.0, "AllocatedStorage": 65.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.WARN, summary="92.31% (warn/crit at 90.00%/95.00%)"),
                Metric(
                    "aws_rds_transaction_logs_disk_usage", 92.3076923076923, levels=(90.0, 95.0)
                ),
            ],
            id="If the TransactionLogsDiskUsage levels are above the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"TransactionLogsDiskUsage": 60.0, "AllocatedStorage": 60.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.CRIT, summary="100.00% (warn/crit at 90.00%/95.00%)"),
                Metric("aws_rds_transaction_logs_disk_usage", 100.0, levels=(90.0, 95.0)),
            ],
            id="If the TransactionLogsDiskUsage levels are below the crit levels, the check state will be CRIT with a appropriate description.",
        ),
        pytest.param(
            {
                "disk": {
                    "TransactionLogsDiskUsage": 60.0,
                    "AllocatedStorage": 60.0,
                    "TransactionLogsGeneration": 10.0,
                }
            },
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.CRIT, summary="100.00% (warn/crit at 90.00%/95.00%)"),
                Metric("aws_rds_transaction_logs_disk_usage", 100.0, levels=(90.0, 95.0)),
                Result(state=State.OK, summary="Generation rate: 10.0 B/s"),
            ],
            id="If the TransactionLogsGeneration is present in the metrics, a result with the state OK and the appropriate description is added.",
        ),
    ],
)
def test_check_aws_rds_transaction_logs_usage(
    section: Mapping[str, Mapping[str, float]],
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_transaction_logs_usage(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert (
        check_result[0] == Result(state=State.OK, summary="60 B")
    )  # The first result is always OK and shows the information about the TransactionLogsDiskUsage in Bytes
    assert check_result == expected_check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"ReplicationSlotDiskUsage": 60.0}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_replication_slot_usage_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_replication_slot_usage(section)) == discovery_result


def test_check_aws_rds_replication_slot_usage_item_not_found() -> None:
    assert not list(
        check_aws_rds_replication_slot_usage(
            item="disk",
            params={},
            section={},
        )
    )


def test_check_aws_rds_replication_slot_usage_metric_not_found() -> None:
    with pytest.raises(KeyError):
        list(
            check_aws_rds_replication_slot_usage(
                item="disk",
                params={},
                section={"disk": {"CPUUtilization": 1}},
            )
        )


def test_check_aws_rds_replication_slot_usage_no_allocated_storage() -> None:
    check_result = list(
        check_aws_rds_replication_slot_usage(
            item="disk",
            params={},
            section={"disk": {"ReplicationSlotDiskUsage": 60.0}},
        )
    )
    assert check_result == [
        Result(state=State.OK, summary="60 B"),
        Result(state=State.WARN, summary="Cannot calculate usage"),
    ]


def test_check_aws_rds_replication_slot_usage_allocated_storage_is_zero() -> None:
    check_result = list(
        check_aws_rds_replication_slot_usage(
            item="disk",
            params={},
            section={"disk": {"ReplicationSlotDiskUsage": 60.0, "AllocatedStorage": 0.0}},
        )
    )
    assert check_result == [
        Result(state=State.OK, summary="60 B"),
        Result(state=State.WARN, summary="Cannot calculate usage"),
    ]


@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"ReplicationSlotDiskUsage": 60.0, "AllocatedStorage": 4000.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.OK, summary="1.50%"),
                Metric("aws_rds_replication_slot_disk_usage", 1.5, levels=(90.0, 95.0)),
            ],
            id="If the ReplicationSlotDiskUsage levels are below the warn/crit levels, the check state will be OK with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"ReplicationSlotDiskUsage": 60.0, "AllocatedStorage": 65.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.WARN, summary="92.31% (warn/crit at 90.00%/95.00%)"),
                Metric(
                    "aws_rds_replication_slot_disk_usage", 92.3076923076923, levels=(90.0, 95.0)
                ),
            ],
            id="If the ReplicationSlotDiskUsage levels are above the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"ReplicationSlotDiskUsage": 60.0, "AllocatedStorage": 60.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="60 B"),
                Result(state=State.CRIT, summary="100.00% (warn/crit at 90.00%/95.00%)"),
                Metric("aws_rds_replication_slot_disk_usage", 100.0, levels=(90.0, 95.0)),
            ],
            id="If the ReplicationSlotDiskUsage levels are above the warn levels, the check state will be CRIT with a appropriate description.",
        ),
    ],
)
def test_check_aws_rds_replication_slot_usage(
    section: Mapping[str, Mapping[str, float]],
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_replication_slot_usage(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert (
        check_result[0] == Result(state=State.OK, summary="60 B")
    )  # The first result is always OK and shows the information about the ReplicationSlotDiskUsage in Bytes
    assert check_result == expected_check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"DatabaseConnections": 10.0}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_connections_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_connections(section)) == discovery_result


def test_check_aws_rds_connections_item_not_found() -> None:
    assert not list(
        check_aws_rds_connections(
            item="disk",
            params={},
            section={},
        )
    )


@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"DatabaseConnections": 10.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.OK, summary="In use: 10.00"),
                Metric("aws_rds_connections", 10.0, levels=(90.0, 95.0)),
            ],
            id="If the levels are below the warn/crit levels, the check state will be OK with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"DatabaseConnections": 92.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.WARN, summary="In use: 92.00 (warn/crit at 90.00/95.00)"),
                Metric("aws_rds_connections", 92.00, levels=(90.0, 95.0)),
            ],
            id="If the levels are above the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"DatabaseConnections": 97.0}},
            {"levels": (90, 95)},
            [
                Result(state=State.CRIT, summary="In use: 97.00 (warn/crit at 90.00/95.00)"),
                Metric("aws_rds_connections", 97.0, levels=(90.0, 95.0)),
            ],
            id="If the levels are above the crit levels, the check state will be CRIT with a appropriate description.",
        ),
    ],
)
def test_check_aws_rds_connections(
    section: Mapping[str, Mapping[str, float]],
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_connections(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert check_result == expected_check_result


@pytest.mark.parametrize(
    "section, discovery_result",
    [
        pytest.param(
            {"disk": {"ReplicaLag": 10.0}},
            [Service(item="disk")],
            id="For every disk in the section a Service with no item is discovered.",
        ),
        pytest.param(
            {},
            [],
            id="If the section is empty, no Services are discovered.",
        ),
    ],
)
def test_aws_rds_replica_lag_discovery(
    section: Mapping[str, Mapping[str, float]],
    discovery_result: Sequence[Service],
) -> None:
    assert list(discover_aws_rds_replica_lag(section)) == discovery_result


def test_check_aws_rds_replica_lag_item_not_found() -> None:
    assert not list(
        check_aws_rds_replica_lag(
            item="disk",
            params={},
            section={},
        )
    )


@pytest.mark.parametrize(
    "section, params, expected_check_result",
    [
        pytest.param(
            {"disk": {"ReplicaLag": 10.0}},
            {"lag_levels": (60, 120)},
            [
                Result(state=State.OK, summary="Lag: 10 seconds"),
                Metric("aws_rds_replica_lag", 10.0, levels=(60.0, 120.0)),
            ],
            id="If the levels are below the warn/crit levels, the check state will be OK with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"ReplicaLag": 92.0}},
            {"lag_levels": (60, 120)},
            [
                Result(
                    state=State.WARN,
                    summary="Lag: 1 minute 32 seconds (warn/crit at 1 minute 0 seconds/2 minutes 0 seconds)",
                ),
                Metric("aws_rds_replica_lag", 92.0, levels=(60.0, 120.0)),
            ],
            id="If the levels are above the warn levels, the check state will be WARN with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"ReplicaLag": 125.0}},
            {"lag_levels": (60, 120)},
            [
                Result(
                    state=State.CRIT,
                    summary="Lag: 2 minutes 5 seconds (warn/crit at 1 minute 0 seconds/2 minutes 0 seconds)",
                ),
                Metric("aws_rds_replica_lag", 125.0, levels=(60.0, 120.0)),
            ],
            id="If the levels are above the crit levels, the check state will be CRIT with a appropriate description.",
        ),
        pytest.param(
            {"disk": {"ReplicaLag": 125.0, "OldestReplicationSlotLag": 120}},
            {"lag_levels": (60, 120)},
            [
                Result(
                    state=State.CRIT,
                    summary="Lag: 2 minutes 5 seconds (warn/crit at 1 minute 0 seconds/2 minutes 0 seconds)",
                ),
                Metric("aws_rds_replica_lag", 125.0, levels=(60.0, 120.0)),
                Result(state=State.OK, summary="Oldest replication slot lag: 120 B"),
                Metric("aws_rds_oldest_replication_slot_lag", 120.0),
            ],
            id="If OldestReplicationSlotLag is present in the metric, a check is executed for this metric as well. The OldestReplicationSlotLag levels are compared to the warn/crit levels from the rule and the appropriate result is given.",
        ),
    ],
)
def test_check_aws_rds_replica_lag(
    section: Mapping[str, Mapping[str, float]],
    params: Mapping[str, Any],
    expected_check_result: Sequence[Result | Metric],
) -> None:
    check_result = list(
        check_aws_rds_replica_lag(
            item="disk",
            params=params,
            section=section,
        )
    )
    assert check_result == expected_check_result
